<template>
  <div style="margin-bottom: 10px;">
    <template v-if="content.length == 0">
      <span>今天没有会员过生日</span>
    </template>
    <template v-else>
      <el-row>
        <el-button size="mini" @click="init()" style="margin: -45px 0 0px 0; float: right;">刷新</el-button>
        <!-- <span>会员生日提醒({{dateFormat(new Date(),'YYYY-MM-DD')}})</span> -->
      </el-row>
      <el-row style="margin-top: 10px;" :gutter="40">
        <el-col :xs="12" :sm="12" :lg="5" v-for="item in content" :key="item.id">
          <el-card>
            <h4>姓名：{{ item.memberName }}</h4>
            <p>电话：{{ item.memberMobile }}</p>
            <img src="../../../assets/img/birthday.png">
          </el-card>
        </el-col>
      </el-row>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      content: []
    };
  },
  activated() {
    this.init();
  },
  methods: {
    init() {
      this.content = [];
      this.$nextTick(() => {
        this.$http({
          url: this.$http.adornUrl(`/member/vipCard/getTodayBirthDayMember`),
          method: "get",
          params: this.$http.adornParams()
        }).then(({ data }) => {
          if (data && data.code === 0) {
            this.content = data.data;
          }
        });
      });
    }
  }
};
</script>
<style lang="scss" scoped>
  .el-card{
    color:#fff;
    background:#53C9B1;
    position:relative;
    border-radius:10px;

    img{
      position:absolute;
      width:40px;
      top:0;
      right:0;
    }
  }
</style>